<!--
    page description : 근태관리 - 관리자 - 사원관리 화면 - 사원등록/수정 (pop_up)
    author      : Yang D
    date        : 2009-02-04
    file name   : emp_mgr_reg_mod_p.jsp
-->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:directive.page import="attend.com.CodeMetrix"/>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	 <s:head theme="ajax" />

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css" href="/inc/css/common.css" />
	<link rel="stylesheet" type="text/css" href="style/style.css" />
	<link rel="stylesheet" type="text/css" href="/inc/css/dhtmlxcalendar.css" />
	
	<script type="text/javascript" src="/inc/js/common.js"></script>
	<script type="text/javascript" src="/js/common.js"></script>
	<script type="text/javascript" src="/js/dhtmlXCommon.js"></script>
	<script type="text/javascript" src="/js/dhtmlxcalendar.js"></script>
	
	<title>사원관리 -등록/수정-</title>
	<!-- // --------------------J A V A S C R I P T-START-------------------- // -->
	<script type="text/javascript" language="javascript">
/////////////////////달력////////////////////////////////////////////////

function doOnLoad(){

		var today = new Date();
		var year = today.getYear();
		var month = today.getMonth() + 1;
		var date = today.getDate();

		if(month < 10){
			month = "0" + month;
		}
		if(date < 10){
			date = "0" + date;
		}

		//document.getElementById('reg_date').value = year + "-" + month + "-" + date
		//var str = year + "-" + month + "-" + date ;
		//document.frm3.reg_date.value = str;

		// 달력
		cal1 = new dhtmlxCalendarObject('apply_dt', false, {isYearEditable: true});
		cal1.setYearsRange(2000, 2050);
		cal1.setPosition(20,-82);
		cal1.draw();
		//cal1.setOnClickHandler(selectDate1);

		cal2 = new dhtmlxCalendarObject('retire_dt', false, {isYearEditable: true});
		cal2.setYearsRange(2000, 2050);
		cal2.setPosition(20,-82);
		cal2.draw();
		// cal2.setOnClickHandler(selectDate2);
		
		cal3 = new dhtmlxCalendarObject('vaca_sdate', false, {isYearEditable: true});
		cal3.setYearsRange(2000, 2050);
		cal3.setPosition(20,-82);
		cal3.draw();
		//cal3.setOnClickHandler(selectDate3);

		cal4 = new dhtmlxCalendarObject('vaca_edate', false, {isYearEditable: true});
		cal4.setYearsRange(2000, 2050);
		cal4.setPosition(20,-82);
		cal4.draw();
		//cal4.setOnClickHandler(selectDate4);

		cal5 = new dhtmlxCalendarObject('reg_date', false, {isYearEditable: true});
		cal5.setYearsRange(2000, 2050);
		cal5.setPosition(20,-82);
		cal5.draw();
		//cal5.setOnClickHandler(selectDate5);
		
		cal6 = new dhtmlxCalendarObject('apply_dt_u', false, {isYearEditable: true});
		cal6.setYearsRange(2000, 2050);
		cal6.setPosition(20,-82);
		cal6.draw();

		document.getElementById('apply_dt').onfocus = function() { if (cal2.isVisible()) cal2.hide(); }
		document.getElementById('retire_dt').onfocus = function() { if (cal1.isVisible()) cal1.hide(); }

		document.getElementById('vaca_sdate').onfocus = function() { if (cal1.isVisible()) cal1.hide(); }
		document.getElementById('vaca_edate').onfocus = function() { if (cal1.isVisible()) cal1.hide(); }

		document.getElementById('reg_date').onfocus = function() { if (cal1.isVisible()) cal1.hide(); }
		document.getElementById('apply_dt_u').onfocus = function() { if (cal1.isVisible()) cal1.hide(); }


		document.body.onclick = function(){calendarHide("cal1,cal2,cal3,cal4,cal5,cal6","D");};

		if ('<s:property value="msg" />' == "<%= CodeMetrix.OK%>") {

			alert("<s:text name="수정되었습니다." />");
			window.close();
			return false;
		}

		if ('<s:property value="msg" />' == "<%= CodeMetrix.DELETE%>") {

			alert("<s:text name="삭제되었습니다." />");
			window.close();
			return false;
		}

	}

	function selectDate1(date)
	{
		document.getElementById('apply_dt').value = cal1.getFormatedDate(null,date);
		dateFrom = new Date(date);
		dateTo = null;
		cal2.setSensitive(dateFrom, dateTo);
		cal1.hide();
		return true;
	}

	function selectDate2(date)
	{
		document.getElementById('retire_dt').value = cal1.getFormatedDate(null,date);
		dateTo = new Date(date);
		dateFrom = null;
		cal1.setSensitive(dateFrom, dateTo);
		cal2.hide();
		return true;
	}

	function selectDate3(date)
	{
		document.getElementById('vaca_sdate').value = cal1.getFormatedDate(null,date);
		dateTo = new Date(date);
		dateFrom = null;
		cal1.setSensitive(dateFrom, dateTo);
		cal3.hide();
		return true;
	}

	function selectDate4(date)
	{
		document.getElementById('vaca_edate').value = cal1.getFormatedDate(null,date);
		dateTo = new Date(date);
		dateFrom = null;
		cal1.setSensitive(dateFrom, dateTo);
		cal4.hide();
		return true;
	}

	function selectDate5(date)
	{
		document.getElementById('reg_date').value = cal1.getFormatedDate(null,date);
		dateTo = new Date(date);
		dateFrom = null;
		cal1.setSensitive(dateFrom, dateTo);
		cal5.hide();
		return true;
	}


/////////////////////달력////////////////////////////////////////////////
		
	//사원 기본정보 저장
	function fnc_submit(f) {

		var theDate = new Date();
		var yearNow = theDate.getFullYear();
		var monthNow = theDate.getMonth()+1;
		var dateNow = theDate.getDate();
		//var in_time = f.in_time_1.value + ":" + f.in_time_2.value;

		if (String(monthNow).length == 1 ){   //월이 1-9값일경우 01-09형식으로 반환
			monthNow = "0"+String(monthNow);
		}
		if (String(dateNow).length == 1 ){
			dateNow = "0"+String(dateNow);
		} 
		
		var date = yearNow+""+monthNow+""+dateNow ;

		var retire_dt = frm.retire_dt.value;
		var retire_date = retire_dt.substring(0,4)+""+retire_dt.substring(5,7)+""+retire_dt.substring(8,10);

		var apply_dt = frm.apply_dt.value;
		var apply_date = apply_dt.substring(0,4)+""+apply_dt.substring(5,7)+""+apply_dt.substring(8,10);

		if ( apply_date < date && apply_date != "" && (retire_date > date || retire_date == "") && frm.work_yn.value == "N") {
			//alert("입사일이 현재일보다 이전입니다.\n재직여부를 'Y'로 변경하십시오.");
			alert("입사/퇴사일을 기준으로 재직중인 사원입니다.\n재직여부를 'Y'로 변경하십시오.");
			return false;
		}
		if ( apply_date > date && apply_date != "" && frm.work_yn.value == "Y") {
			//alert("입사일이 현재일보다 이후입니다.\n재직여부를 'N'로 변경하십시오.");
			alert("입사/퇴사일을 기준으로 재직중인 사원이 아닙니다.\n재직여부를 'N'로 변경하십시오.");
			return false;
		}
		if ( retire_date > date && retire_date != "" && (apply_date < date || apply_date == '') && frm.work_yn.value == "N") {
			//alert("퇴사일이 현재일보다 이후입니다.\n재직여부를 'Y'로 변경하십시오.");
			alert("입사/퇴사일을 기준으로 재직중인 사원입니다.\n재직여부를 'Y'로 변경하십시오.");
			return false;
		}
		if ( retire_date < date && retire_date != "" && frm.work_yn.value == "Y") {
			
			//alert("퇴사일이 현재일보다 이전입니다.\n재직여부를 'N'으로 변경하십시오.");
			alert("입사/퇴사일을 기준으로 재직중인 사원이 아닙니다.\n재직여부를 'N'로 변경하십시오.");
			return false;
		}
		if ( frm.crud_type.value != "U" && frm.id_chk_flag.value == "N") {
			alert("아이디 중복체크를 하시기 바랍니다.");
			return false;
		}

		if (!fnc_validate(f)) {
			return false;
		}
		
		f.action = "insertEmpInfo.action";
	}

	function isValidate(f) {

		var idx = f.group_no.selectedIndex;
    	var opt = f.group_no.options[idx];
    		
    	var tidx = f.steam.selectedIndex;
    	var topt = f.steam.options[tidx];
    	
    	if (idx != 0 && tidx == 0) {
    		alert("권한을 추가할 팀을 \n\n올바르게 선택하여 주시기 바랍니다.");
    		f.group_no.selectedIndex = 0;
    		return false;
    	}
    	
    	if (typeof f.a_team_no.length == "undefined") {
    		if (opt.value.length == 0) {
    			alert("<s:text name="alert.message.selectGroupname" />");
	    		f.group_no.focus();
	    		return false;
    		}
    		
    		if (topt.value == "ALL") {
    			alert("<s:text name="alert.message.selectTeamName" />");
	    		f.steam.focus();
	    		return false;
    		}
    		
    		//팀코드를 넘긴다.
			f.a_team_no.value = topt.value;
		
    	} else {
    		f.a_team_no[f.a_team_no.length - 1].value = topt.value;	//팀코드를 히든으로 전달한다.
    	}

		return true;
	}

	//사원 휴직정보 수정(수정전)
	function fnc_submit_vacation(f2,f3) {
		if(confirm("휴직정보를  수정하시겠습니까?")){

		var sdate = f2.vaca_sdate.value;
    	var edate = f2.vaca_edate.value;
    	var rdate = f2.reg_date.value;
    	var remark = f2.vaca_remark.value;
    	var cnt=0;

		
    	
    	alert(f2.vaca_sdate.length);
    	alert(f2.vaca_sdate[0].value);
    	alert(f2.vaca_sdate[1].value);

			f2.action = "updateEmpVacation_p.action";
	    	f2.submit();

			return false;
		}
	}

	/*function fnc_update_submit(f){
		window.close();
		fnc_update_submit_2(f);
		
	}*/

	//휴직 수정(수정후)
	function fnc_update_submit(f) {

		if(fnc_check(f)){

    		var w = 300;
	       	var h = 100;
	       
	       	var x = fnc_center_x(w);
	       	var y = fnc_center_y(h);
	       	var ch_seq_no = document.frm3.ch_seq_no.value;
	       	var emp_no = document.frm2.emp_no.value;
	       	
	    	var uri 	= 	"updateEmpDeptLongvacation_p.action?ch_seq_no=" + ch_seq_no + "&emp_no=" + emp_no ;
	    	//var uri 	= 	"updateEmpDeptLongvacation_p.action?emp_no="+emp_no;
	    	var nm		=	"p_emp";
	    	var attr    =   "width=" + w + " , height=" + h + " , top=" + y + " , left=" + x + " , status=no";       //window size

	    	window.open(uri , nm , attr);

			return false;
		}

	}

    //popup 정가운데 띄우기
	function fnc_center_x(w) {

       	var x;
       	
		x =  (screen.availWidth - w) / 2;

       	return x;
	}

  	//popup 정가운데 띄우기
	function fnc_center_y(h) {

       	var y;
       	
		y =  (screen.availHeight - h) / 2;

       	return y;
	}


	

	//휴직 삭제
	function fnc_delete_submit(f) {
		//alert("here!!");
		if(confirm("휴직정보를 삭제하시겠습니까?")){
			if(fnc_check(f)){
			//alert("f>>>"+f);
			//alert("a");
			
			//hidden값에 체크된 emp_no 담기
			//document.frm2.getElementById("ch_seq_no").value = args;
			//document.frm2.ch_seq_no.value = args;
			//alert("args>>>"+args);
			//alert("document.frm2.ch_seq_no.value>>>"+document.frm2.ch_seq_no.value);
			//alert("b");
	
			document.frm3.action = "deleteEmpVacation_p.action"   //form action 설정.
			document.frm3.submit();

			return false;
			}

		}else{
			return false;
		}
	}

	function fnc_check(field) {
	
		//alert("field>>>"+field);

		var args;

		args = new Array();	//배열생성

		if (!field) {
			alert("<s:text name="alert.message.notCheck" />");
			return false;
		}
	
		//체크박스가 하나일 경우 처리하는 로직
		if (!field.length) {
			//alert(1);
			if (!field.checked) {
				alert("<s:text name="alert.message.requiedCheck"/>");
				field.focus();
				return false;
			} else {
				//alert(2);
				args.push(field.value);
				return true;
			}
		}
		
		var checkflag = false;	//check init
		
		//체크된것이 없을시에 알람 메시지 출력
		//alert("field.length>>>"+field.length);	//checkbox 갯수
		for(i = 0 ; i < field.length ; i++) {
			if (!field[i].checked) {
				continue;
			} else {
				//alert(3);
				checkflag = true;
				//alert("field[i].value>>>"+field[i].value)
				args.push(field[i].value);	//배열에 값을 넣는다.
				//alert("args>>>>>>>>"+args);
				document.frm3.ch_seq_no.value = args;
				return true;
				
			}
		}
		
		//체크되지 않았으면 메시지 출력
		if (!checkflag) {
			//alert(4);
			alert("<s:text name="alert.message.selectData" />");
			return false;
		}
	
		return true;
		
	}

	//미입력 체크

	function fnc_validate(f) {
	//성명
	
		if (f.emp_nm == null || f.emp_nm.value == "" ) {
			alert("<s:text name="alert.message.inputEmpName" />");
			f.emp_nm.focus();
			return false;
		}
		if(f.emp_nm.value.search(/\s/g)>-1){
	       alert("공백문자는 허용하지 않습니다.");
	       f.emp_nm.focus();
	       return false;
		}
		
			
		<s:if test='crud_type != "U"'>
			//비번
			if (f.pass == null || f.pass.value == "" ) {
				alert("<s:text name="alert.message.inputPassword" />");
				f.pass.focus();
				return false;
			}
				
		</s:if>
		//아이디
		if (f.user_id == null || f.user_id.value == "" ) {
			alert("<s:text name="alert.message.inputID" />");
			f.user_id.focus();
			return false;
		}
		//입사일
		if (f.apply_dt == null || f.apply_dt.value == "" ) {
			alert("입사<s:text name="alert.message.requiedDate" />");
			f.apply_dt.focus();
			return false;
		}
		//적용확인
		if (confirm("<s:text name="alert.message.questionApply" />")) {
			return true;
		} else {
			return false;
		}
		
	}  	

	//출근정보 저장시
	// ajax를 적용하여 opener의 죄회 데이터를 바로 적용함.
    function fnc_apply_change() {
		
        var rtn_msg = "<s:property value="msg" />";
        
        if (rtn_msg == "OK") {
	        alert("<s:text name="alert.message.applied" />");
	        window.close();
	        opener.call_dojo();
	        return false;
        } else if (rtn_msg == "INIT") {
        	alert("<s:text name="alert.message.initPwd" />");
        	window.close();
        	return false;
		}
        
        if(rtn_msg.length != 0) {
            alert(rtn_msg);
            window.close();
            opener.call_dojo();
        }
        
    }

	//재직여부를 N으로 하면 퇴직일을 적용함.
    function fnc_retire() {
		
	}

	//비밀번호 초기화
	function fnc_pwd_init(f) {
		if (!confirm("<s:text name="alert.question.initPwd" />")) {
			return false;
		} else {
			f.action = "pwd_init_p.action";
			f.submit();
		}
		return false;
	}	
	
	//아이디입력시 영문과 숫자만 입력가능하게함.(1~10)자까지 가능.
	function fnc_validate_id(sValue) {
		if (checkID(sValue))
		{
		  alert('\nID는 영어와 숫자만 사용할 수 있습니다.\n\n(한글,특수문자,space사용불가)');
		  //document.frm.user_id.value = "" ;
		  document.frm.user_id.focus();
		  return false;
		}
	}

	//영문숫자만 가능.
	function GetOnlyNumEng(ths){
	   var NumEng = /^[A-Za-z0-9]+$/;

	   if(NumEng.test(ths.value) || ths.value == ""){}
	   else{
		   alert('\nID는 영어와 숫자만 사용할 수 있습니다.\n\n(한글,특수문자,space사용불가)');
	     ths.value = "";
	     ths.focus();
	   }

	}

	//ID 중복 체크
	function fnc_id_dup_chk() {

		var f	=	document.frm;

		f.modeType.value = "VERIFICATION";

		if (f.user_id.value == "") {
			alert("아이디를 입력하시기 바랍니다.");
			f.user_id.focus();
			return false;
		}

		GetOnlyNumEng(f.user_id);

		dojo.event.topic.publish("ajaxDojo");
		return false;
	}

	</script>
	<!-- //-- --------------------J A V A S C R I P T-E N D-------------------- // -->
</head>
<s:if test='crud_type == "U"'>

<body onload="fnc_apply_change();doOnLoad();">
        <s:form name="frm" id="frm" method="post" theme="simple" onsubmit="return fnc_submit(this)">
        <!--s:form name="frm" id="frm" method="post" theme="simple" -->
        
        	<input type="hidden" id="id_chk_flag" name="id_chk_flag" value="N" />
        	<input type="hidden" name="emp_no" id="emp_no" value="<s:property value="emp_no" />" />   
        	
        	<s:hidden name="msg" id="msg" 		/>				<!-- 저장 메시지 출력 -->
        	
        	<s:hidden name="crud_type" id="crud_type"	/>
        	
        	<s:hidden id="modeType" name="modeType" /><!-- ID중복확인 버튼 클릭시에만 메시지 보이게함. -->
          	
        	<div id="popup_850se_top"></div>
        	<div id="popup_800se_bg">
		    	<div id="popup_325se">
		    		<div id="popup_325se_box">
		    		<table class="pop550se_Tbl_new">
		    			<tr>
			    			<th class="txt">부서</th>
			    			<td><s:select name="dept_no" 	id="dept_no" 	list="listDept" 	listKey="dept_no" listValue="dept_nm" cssClass="combobox180se" /></td>	
			    			<th class="txt">직책</th>
			    			<td><s:select name="position_no" id="position_no" list="listPosition" listKey="cd" listValue="cd_nm" cssClass="combobox90se" /></td>		    			
		    			</tr>		    			
		    			<s:if test='crud_type != "U"'>
		    			<tr>
			    			<th class="txt">비밀번호</th>
			    			<td><s:password name="pass" maxlength="10" cssClass="input_90se" /></td>
		    			</tr>
		    			</s:if>
		    			<tr>
			    			<th class="txt">성명</th>
			    			<td><s:textfield name="emp_nm" maxlength="10" cssClass="input_90se" /></td>	
			    			<th class="txt">직급</th>
			    			<td><s:select name="rank_no" 	id="rank_no" 	list="listRank" 	listKey="cd" 	listValue="cd_nm" cssClass="combobox90se" /></td>
		    			</tr>
		    			<tr>
			    		<th class="txt">아이디</th>
			    			<td>
			    			<s:if test='crud_type != "U"'>
			    				<s:textfield name="user_id" maxlength="10" cssClass="input_90se" onkeyup="return GetOnlyNumEng(this)" />
			    			</s:if>
			    			<s:else>
			    				<s:textfield name="user_id" maxlength="10" cssClass="input_90se" onkeyup="return GetOnlyNumEng(this)" readonly="readonly" />
			    			</s:else>
			    			</td>
			    			<s:if test='crud_type != "U"'>
			    				<li>&nbsp;<img src="./images/btn_admin_search.gif" style="cursor: pointer;"  alt="아이디 중복 체크" title="아이디 중복 체크" onclick="return fnc_id_dup_chk()" /></li>
			    			</s:if>		  
			    			<th class="txt">재직여부</th>
			    			<td><s:select name="work_yn" id="work_yn" list="#{'Y':'Y' , 'N':'N'}" cssClass="combobox90se" onchange="fnc_retire()"/></td>			    			
		    			</tr>
		    			<tr>
			    			<th class="txt">출근시간</th>
			    			<td><s:select name="in_time_1" id="in_time_1" list="#{' 07':'07' , ' 08':'08' , ' 09':'09' , ' 10':'10' , ' 11':'11' , ' 12':'12'}" cssClass="combobox40se"/>
			    			시
			    			<s:select name="in_time_2" id="in_time_2" list="#{'00':'00' , '05':'05' , '10':'10' , '15':'15' , '20':'20' , '25':'25' , '30':'30' , '35':'35' , '40':'40' , '45':'45' , ' 50':'50' , '55':'55'}" cssClass="combobox40se"/>
			    			분 
			    			</td>
			    			<th class="txt">퇴근시간</th>
			    			<td><s:select name="out_time_1" id="out_time_1" list="#{' 15':'15' ,' 16':'16' , ' 17':'17' , ' 18':'18' , ' 19':'19' , ' 20':'20'}" cssClass="combobox40se"/>
			    			시
			    			<s:select name="out_time_2" id="out_time_2" list="#{'00':'00' , '05':'05' , '10':'10' , '15':'15' , '20':'20' , '25':'25' , '30':'30' , '35':'35' , '40':'40' , '45':'45' , ' 50':'50' , '55':'55'}" cssClass="combobox40se"/>
			    			분 
			    			</td>
		    			</tr>
		    			
		    			<tr>
			    			<th class="txt">입사일자</th>
			    			<td><input type="text" size="12" maxlength="10" name="apply_dt" id="apply_dt_u" value="<s:property value="apply_dt" />" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:hand" /></td>
			    			<th class="txt">퇴사일자</th>
			    			<td><input type="text" size="12" maxlength="10" name="retire_dt" id="retire_dt" value="<s:property value="retire_dt" />" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:hand" /></td>
		    			</tr>    			
		    			</table>
		    		</div>
		    	</div>
		    		<div id="popup_btn">
		    			<s:if test='crud_type == "U"'>
		    				<s:submit type="image" src="/images/btn_pw.gif" value="비밀번호 초기화" onclick="return fnc_pwd_init(this.form)"/>
		    			</s:if>
		    			&nbsp;<s:submit type="image" src="/images/btn_save.gif" value="저장" />
		    		</div>		    	
        	</div>
        	<br/>

        </s:form>
        <!-- ajax dummy -->
		<s:url id="temp_list"  action="empIdDupCheck_p" />
		<s:div id="tempDiv" theme="ajax" executeScripts="true" showLoadingText="false" href="%{temp_list}" listenTopics="ajaxDojo" formId="frm" />
</body>

<body >
    <div id="popup_800se_bg">
        <s:form name="frm2" id="frm2" method="post" theme="simple">
        <!--s:form name="frm2" id="frm2" method="post" theme="simple" onsubmit="return fnc_submit_vacation(this)"-->
        	<s:hidden name="msg" 		/>				<!-- 저장 메시지 출력 -->
        	<s:hidden name="crud_type"	/>
        	<s:hidden id="ch_seq_no" name="ch_seq_no"/>
        	<input type="hidden" name="h_emp_no" id="h_emp_no" value="<s:property value="emp_no" />" />      
        	<input type="hidden" name="emp_no" id="emp_no" value="<s:property value="emp_no" />" />   
			<table class="pop800se_Tbl" border="1">
				<tr>
					<!--td class="th_header" style="text-align:center;"><input type="checkbox" id="selectAll" name="selectAll" onclick="selectCheck()" /></td-->
					<td class="th_header" style="text-align:center;"></td>
					<td class="th_header" style="text-align:center;">순번</td>
					<td class="th_header" style="text-align:center;">성명</td>
					<td class="th_header" style="text-align:center;">휴직시작일</td>
					<td class="th_header" style="text-align:center;">휴직종료일</td>
					<td class="th_header" style="text-align:center;">휴직유형</td>
					<td class="th_header" style="text-align:center;">휴직배정일자</td>
					<td class="th_header" style="text-align:center;">휴직사유</td>
				</tr>
				<s:iterator value="list" id="iter" status="row">
				<tr>
					<td style="text-align:center;"><input type="radio" id="d_chk" name="d_chk" value="<s:property value="seq"/>" <s:if test='close_dt == "Y"' >disabled="disabled"</s:if> /></td>
			        <td style="text-align:center;"><s:property value="%{#row.index + 1}"/><s:hidden name="seq" /><input type="hidden" name="a_seq" value="<s:property value="seq"/>" /></td>
			        <td style="text-align:center;"><s:property value="emp_nm"/><input type="hidden" name="a_emp_no2" value="<s:property value="emp_no"/>" /></td>
			        <td style="text-align:center;"><input type="text" size="12" maxlength="10" name="vaca_sdate" id="vaca_sdate" value="<s:property value="vaca_sdate" />" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:hand" disabled="disabled"/></td>
			        <td style="text-align:center;"><input type="text" size="12" maxlength="10" name="vaca_edate" id="vaca_edate" value="<s:property value="vaca_edate" />" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:hand" disabled="disabled"/></td>
			        
			    <s:if test='vaca_kind == 2001' >
			        <td style="text-align:center;" disabled="disabled"><s:select id="vaca_kind" name="vaca_kind" list="#{'2001':'유급(연차휴가)' , '2005':'무급(기타휴가)'}" cssClass="combobox100se" /></td>			       
			    </s:if>
			    <s:if test='vaca_kind == 2005' >
			    	<td style="text-align:center;" disabled="disabled"><s:select id="vaca_kind" name="vaca_kind" list="#{'2005':'무급(기타휴가)' , '2001':'유급(연차휴가)'}" cssClass="combobox100se" /></td>			       
			    </s:if>    

			        <!--td style="text-align:center;"><s:select id="vaca_kind" name="vaca_kind" list="#{'2001':'유급휴가(연차휴가)' , '2005':'무급휴가(기타휴가)'}" cssClass="combobox130se"/></td-->
			        <td style="text-align:center;"><input type="text" size="12" maxlength="10" name="reg_date" id="reg_date" value="<s:property value="reg_date" />" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:hand" disabled="disabled"/></td>			        
			        <td style="text-align:center;"><input type="text" maxlength="30" name="vaca_remark" id="a_vaca_remark" value="<s:property value="vaca_remark" />" disabled="disabled"></input></td>
			    </tr>
				</s:iterator>

		</s:form>  
		<s:form name="frm3" id="frm3" method="post" theme="simple"> 
        	<s:hidden name="msg" 		/>				<!-- 저장 메시지 출력 -->
        	<s:hidden name="crud_type"	/>
        	<s:hidden id="ch_seq_no" name="ch_seq_no"/>
        	<input type="hidden" name="h_emp_no" id="h_emp_no" value="<s:property value="emp_no" />" />
        	<input type="hidden" name="emp_no" id="emp_no" value="<s:property value="emp_no" />" />

			</table>
						
			<div id="popup_btn">
				<!--s:submit type="image" name="img_save" id="img_save" src="/images/btn_save.gif" value="저장" onclick="return fnc_submit_vacation(this.form)"/-->
				<s:submit type="image" name="img_save" id="img_save" src="/images/btn_update.gif" value="수정" onclick="return fnc_update_submit(frm2)"/>
				<!--s:submit type="image" name="img_save" id="img_save" src="/images/btn_save.gif" value="저장" onclick="return fnc_submit_vacation(frm2,frm3)"/-->
				&nbsp;<s:submit type="image" name="img_save2" id="img_save2" src="/images/btn_sdelete.gif" value="삭제" onclick="return fnc_delete_submit(frm2)"/>
			</div>
			<br></br>
		    <!---------------Bottom : STR----------->
			<div id="popup_800se_bottom"><img src="/images/pop_btn_close.gif"  onclick="window.close();" style="cursor: pointer;"/></div>
			<!---------------Bottom : END----------->
        </s:form>       
    </div>  
</body>
</s:if>
<s:if test='crud_type != "U"'>
<body onload="fnc_apply_change();doOnLoad();">
        <s:form name="frm" id="frm" method="post" theme="simple" onsubmit="return fnc_submit(this)">
        
        	<input type="hidden" id="id_chk_flag" name="id_chk_flag" value="N" />
        	
        	<s:hidden name="msg" id="msg" 		/>				<!-- 저장 메시지 출력 -->
        	
        	<s:hidden name="emp_no"	/>
        	<s:hidden name="crud_type" id="crud_type"	/>
        	
        	<s:hidden id="modeType" name="modeType" /><!-- ID중복확인 버튼 클릭시에만 메시지 보이게함. -->
        	
        	<div id="popup_350se_top" ></div>
        	<div id="popup_350se_bg">
		    	<div id="popup_325se">
		    		<div id="popup_325se_box">
		    			<ul>
			    			<li class="txt">성명</li>
			    			<li><s:textfield name="emp_nm" maxlength="10" cssClass="input_120se" /></li>
		    			</ul>
		    			<ul>
			    			<li class="txt">아이디</li>
			    			<li>
			    			<s:if test='crud_type != "U"'>
			    				<s:textfield name="user_id" maxlength="10" cssClass="input_120se" onkeyup="return GetOnlyNumEng(this)" />
			    			</s:if>
			    			<s:else>
			    				<s:textfield name="user_id" maxlength="10" cssClass="input_120se" onkeyup="return GetOnlyNumEng(this)" readonly="readonly" />
			    			</s:else>
			    			</li>
			    			<s:if test='crud_type != "U"'>
			    				<li>&nbsp;<img src="./images/btn_admin_search.gif" style="cursor: pointer;"  alt="아이디 중복 체크" title="아이디 중복 체크" onclick="return fnc_id_dup_chk()" /></li>
			    			</s:if>
		    			</ul>
		    			<s:if test='crud_type != "U"'>
		    			<ul>
			    			<li class="txt">비밀번호</li>
			    			<li><s:password name="pass" maxlength="10" cssClass="input_120se" /></li>
		    			</ul>
		    			</s:if>
		    			<ul>
			    			<li class="txt">부서</li>
			    			<li><s:select name="dept_no" 	id="dept_no" 	list="listDept" 	listKey="dept_no" listValue="dept_nm" cssClass="combobox180se" /></li>
		    			</ul>
		    			<ul>
			    			<li class="txt">직책</li>
			    			<li><s:select name="position_no" id="position_no" list="listPosition" listKey="cd" listValue="cd_nm" cssClass="combobox180se" /></li>
		    			</ul>
		    			<ul>
			    			<li class="txt">직급</li>
			    			<li><s:select name="rank_no" 	id="rank_no" 	list="listRank" 	listKey="cd" 	listValue="cd_nm" cssClass="combobox180se" /></li>
		    			</ul>
		    			<ul>
			    			<li class="txt">재직여부</li>
			    			<li><s:select name="work_yn" id="work_yn" list="#{'Y':'Y' , 'N':'N'}" cssClass="combobox180se" onchange="fnc_retire()"/></li>
		    			</ul>
		    			<ul>
			    			<li class="txt">출근시간</li>
			    			<li>
				    			<s:select name="in_time_1" id="in_time_1" list="#{' 07':'07' , ' 08':'08' , ' 09':'09' , ' 10':'10' , ' 11':'11' , ' 12':'12'}" cssClass="combobox40se"/>
				    			시
				    			<s:select name="in_time_2" id="in_time_2" list="#{'00':'00' , '05':'05' , '10':'10' , '15':'15' , '20':'20' , '25':'25' , '30':'30' , '35':'35' , '40':'40' , '45':'45' , ' 50':'50' , '55':'55'}" cssClass="combobox40se"/>
				    			분
			    			</li>
		    			</ul>
		    			<ul>
			    			<li class="txt">퇴근시간</li>
			    			<li>				  
			    				<s:select name="out_time_1" id="out_time_1" list="#{' 15':'15' ,' 16':'16' , ' 17':'17' , ' 18':'18' , ' 19':'19' , ' 20':'20'}" cssClass="combobox40se"/>
				    			시
				    			<s:select name="out_time_2" id="out_time_2" list="#{'00':'00' , '05':'05' , '10':'10' , '15':'15' , '20':'20' , '25':'25' , '30':'30' , '35':'35' , '40':'40' , '45':'45' , ' 50':'50' , '55':'55'}" cssClass="combobox40se"/>
				    			분
							</li>
		    			</ul>
		    			<ul>
			    			<li class="txt">입사일자</li>
			    			<li><input type="text" size="12" maxlength="10" name="apply_dt" id="apply_dt" value="<s:property value="apply_dt" />" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:hand" /></li>
		    			</ul>
		    			<ul>
			    			<li class="txt">퇴사일자</li>
			    			<li><input type="text" size="12" maxlength="10" name="retire_dt" id="retire_dt" value="<s:property value="retire_dt" />" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:hand" /></li>
		    			</ul>
		    		</div>
		    		<div id="popup_btn">
		    			<s:if test='crud_type == "U"'>
		    				<s:submit type="image" src="/images/btn_pw.gif" value="비밀번호 초기화" onclick="return fnc_pwd_init(this.form)"/>
		    			</s:if>
		    			&nbsp;<s:submit type="image" src="/images/btn_save.gif" value="저장" onclick="return fnc_submit(this.form)"/>
		    		</div>
		    	</div>
        	</div>
        	<br/><br/><br/><br/><br/>
		    <!---------------Bottom : STR----------->
			<div id="popup_350se_bottom"><img src="/images/pop_btn_close.gif" onclick="window.close();" style="cursor: pointer;"/></div>
			<!---------------Bottom : END----------->
        </s:form>
        <!-- ajax dummy -->
		<s:url id="temp_list"  action="empIdDupCheck_p" />
		<s:div id="tempDiv" theme="ajax" executeScripts="true" showLoadingText="false" href="%{temp_list}" listenTopics="ajaxDojo" formId="frm" />
</body>
</s:if>

</html>

